//package com.itheima.consumer.Consumer;
//
//import lombok.extern.slf4j.Slf4j;
//import org.springframework.amqp.core.ExchangeTypes;
//import org.springframework.amqp.rabbit.annotation.Exchange;
//import org.springframework.amqp.rabbit.annotation.Queue;
//import org.springframework.amqp.rabbit.annotation.QueueBinding;
//import org.springframework.amqp.rabbit.annotation.RabbitListener;
//import org.springframework.stereotype.Component;
//
//@Component
//@Slf4j
//public class consumer02 {
//    @RabbitListener(bindings = @QueueBinding(
//            value =@Queue(name = "queue02",durable = "true"),
//            exchange = @Exchange(name = "exchange02",type = ExchangeTypes.DIRECT),
//            key = {"zky"}
//    ))
//    void testConsumer(String msg) {
//        //如果抛出异常后会将消息路由到指定队列
//        try {
//            log.info("consumer02收到消息:{}",msg);
////            throw new RuntimeException("test error");
//        } catch (RuntimeException e) {
//            log.debug("重试");
//            throw new RuntimeException(e);
//        }
//
//
//    }
//}
